<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of admins
 *
 * @author Maulnick
 */
class Document_Entity extends CI_Model
{
    // Force Extending class to define this method
    public function init($role_doc_id, $doc_id=null, $document){
        $this->role_document_id = $role_doc_id;
        $this->document_id = $doc_id;
        $this->_data = $document;
    }
    protected $role_document_id;
    protected $document_id;
    protected $_data;
    // Common method
    public function get_document_id() {
        return $this->document_id;
    }
    public function set_document_id($id) {
        $this->document_id=$id;
    }
    public function get_role_document_id() {
        return $this->role_document_id;
    }
    public function set_role_document_id($id) {
        $this->role_document_id=$id;
    }
    public function get_creation_date() {
        return $this->creation_date;
    }
    public function set_creation_date($date) {
        $this->creation_date=$date;
    }
    // magic methods!
    public function __set($document, $value){
        return $this->_data[$document] = $value;
    }

    public function __get($document){
        $CI =& get_instance();
        return $CI->$document;
      return array_key_exists($document, $this->_data)
        ? $this->_data[$document]
        : null
      ;
    }
    public function get_data(){
        return $this->_data;
    }
    public function set_data($data){
        $this->_data = $data;
    }
    public function save(){}
    public function load($id){}
}